/*******************************************************************************
 * Copyright (c) 2006 CEA List.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     CEA List - initial API and implementation
 *******************************************************************************/
package com.cea.papyrus.core.commands.connection;

import org.eclipse.draw2d.geometry.Point;

import com.cea.papyrus.diagraminterchange2.di2.GraphEdge;
import com.cea.papyrus.diagraminterchange2.di2.GraphElement;

/**
 * Command that moves an association from one source to another.
 */
public class RoleBindingReconnectCommand extends ConnectionReconnectCommand {
	
	/**
	 * Creates a new AssociationReconnectCommand.
	 * 
	 * @param newEndpoint the new end point for the graph edge
	 * @param end integer that indicates if it is the source or the target
	 * connection point that is moved. Values can be
	 * <code>ConnectionCommandBase.SOURCE</code> or
	 * <code>ConnectionCommandBase.TARGET</code>.
	 * @param conn the graph edge that represents the association to be reconnected
	 * @param newLocation the new location
	 */
	public RoleBindingReconnectCommand(GraphEdge conn, GraphElement newEndpoint, Point newLocation, int end) {
		super(conn, newEndpoint, newLocation, end);
	}

	/**
	 * 
	 * 
	 * @return 
	 */
	public boolean canExecute() {
		return (getNewSource().equals(getOldSource())&& getNewTarget().equals(getOldTarget()));
		
	}
	/* (non-Javadoc)
	 * @see com.cea.papyrus.core.common.commands.ConnectionReconnectCommand#executeOnBussiness()
	 */
	/**
	 * 
	 */
	@Override
	public void executeOnBussiness() {
	}
	
	/* (non-Javadoc)
	 * @see com.cea.papyrus.core.common.commands.ConnectionReconnectCommand#undoOnBussiness()
	 */
	/**
	 * 
	 */
	@Override
	public void undoOnBussiness() {
	}	

}
